package com.ssm.student.controller;

import com.ssm.student.model.Personal;
import com.ssm.student.model.Role;
import com.ssm.student.service.impl.PersonalServicelmpl;
import com.ssm.student.service.impl.RoleServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "personal")
@RestController

public class PersonalController {
   //int insertPersonal(Personal personal);
   @Autowired
   private PersonalServicelmpl personalService;
    @ApiOperation(value = "人员添加")
    @RequestMapping(value = "/addPersonal",method = RequestMethod.GET)
    public int AddPersonal(Personal personal){
        //传入数据的判断
        int IsAdd=0;
        //（1）角色实体不能为空
        if(personal!=null){
            //（2）角色名称不能为空
            if(personal.getPersonalnumber()!=null){
                //(3)添加角色数据
                personalService.insertPersonal(personal);
            }
        }
        return IsAdd;    }
}

